//
//  JobSingleViewController.m
//  警用舆情平台
//
//  Created by 郭斌 on 15/6/20.
//  Copyright (c) 2015年 魏强. All rights reserved.
//

#import "JobSingleViewController.h"
#import "AFNetworking.h"
#import "AFHTTPRequestOperation.h"
#import "GBShowPhotoViewController.h"
#import "UIImageView+WebCache.h"
#import "KDReginDataTool.h"
#import "GBUrlWebViewController.h"
//#define baseUrl @"http://192.168.1.41/KdGovWeb/MobileAction.do?method=getReportDetail&token="

@interface JobSingleViewController ()<UICollectionViewDataSource,UICollectionViewDelegate,UICollectionViewDelegateFlowLayout>
{
    UIView *topView; //顶部视图
    UIButton *backBtn; //返回按钮
    UILabel *topLable; //
    
    //6.21
    UILabel *neiRongLabel; //内容label;
    UIView *neiRongView; //内容view
    
    float contentWLabel; //动态计算label的宽度
    float contentHLabel; //动态计算label的高度
    
    //8.10
    NSMutableArray *photoArray; //图片的数组
    UICollectionView *photosCollectionView; //显示图片
    float PhotoWidth; //每张照片的宽度；
    UIScrollView *sscroll; //底部的scroll
    
    //8.25
    NSMutableArray *kindArr; //线索类型name
    NSMutableArray *kindIdArr; //线索类型id
    
    //9.7
    UIView *vv;
    UIView *vv2;
    
    //2016/3/16
    NSArray *websiteTypeArray;
}

@end

@implementation JobSingleViewController

-(id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if(self)
    {
        // Custom initialization
        _photoArrayUrl = [NSMutableArray array];
        kindArr = [NSMutableArray array];
        kindIdArr = [NSMutableArray array];
        websiteTypeArray = @[@"新闻网站",@"社交网站",@"论坛",@"微博",@"博客",@"微信",@"及时通讯",@"视频网站",@"国内门户及论坛",@"省内门户及论坛",@"其他"];
    }
    return self;
}

- (void)viewDidLoad {
    [super viewDidLoad];
    [self requestData];
    //NSLog(@"photo = %@",_photoArrayUrl);
    //创建底部的scroll
    [self createScrollV];
    PhotoWidth = (screenW - 50) / 4.0;
    photoArray = [NSMutableArray array];
    self.navigationController.navigationBar.barStyle = UIStatusBarStyleDefault;
    [self.navigationController.navigationBar setTintColor:[UIColor whiteColor]];
    //self.navigationItem.title = self.titleee;
    self.view.backgroundColor = WQColor(241, 243, 244);
    //初始化界面
    //NSLog(@"1111%@", _infoType);
    if([_infoType isEqualToString:@"单条"] || [_infoType isEqualToString:@"落地申请"])
    {
        //creteview2图片上报
        dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1.0f * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
            [self createView2];
        });
//        NSTimer *timer = [NSTimer scheduledTimerWithTimeInterval:1.0f target:self selector:@selector(createView2) userInfo:nil repeats:NO];
    }
    else
    {
        //createview1普通上报
        dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1.0f * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
            [self createView1];
        });
//        NSTimer *timer = [NSTimer scheduledTimerWithTimeInterval:1.0f target:self selector:@selector(createView1) userInfo:nil repeats:NO];
    }
    // Do any additional setup after loading the view.
}

#pragma mark - 请求线索类型
-(void)requestData
{
    NSString *urll = [NSString stringWithFormat:@"%@&method=reportType", ServerActionAddr];
    NSURLRequest *httpReq = [[NSURLRequest alloc] initWithURL:[NSURL URLWithString:urll]];
    //NSLog(@"%@",urll);
    AFHTTPRequestOperation *reqOper = [[AFHTTPRequestOperation alloc] initWithRequest:httpReq];
    [reqOper setCompletionBlockWithSuccess:^(AFHTTPRequestOperation *op,id success){
        NSHTTPURLResponse *response = [op response];
        NSInteger code = [response statusCode];
        if (code == 200)
        {
            NSDictionary *jsonDict = [NSJSONSerialization JSONObjectWithData:[op responseData] options:NSJSONReadingMutableContainers error:nil];
            if([jsonDict[@"status"] isEqualToString:@"ok"])
            {
                NSMutableArray *info = jsonDict[@"data"];
                for(NSDictionary *dic in info)
                {
                    [kindArr addObject:dic[@"name"]];
                    NSString *idd = [NSString stringWithFormat:@"%d",[dic[@"clueType_id"] intValue]];
                    [kindIdArr addObject:idd];
                }
            }
        }
    } failure:^(AFHTTPRequestOperation *op, NSError *error) {
        if (error) {
            //NSLog(@"req error %@",error);
            
            UIAlertView *promptAlert = [[UIAlertView alloc] initWithTitle:@"请检查网络" message:nil delegate:nil cancelButtonTitle:nil otherButtonTitles:nil];
            [NSTimer scheduledTimerWithTimeInterval:1.50f
                                             target:self
                                           selector:@selector(timerFireMethod:)
                                           userInfo:promptAlert
                                            repeats:YES];
        }
    }];
    [reqOper start];
}

#pragma mark - 弹出的对话框内容
- (void)timerFireMethod:(NSTimer*)theTimer//弹出框
{
    UIAlertView *promptAlert = (UIAlertView*)[theTimer userInfo];
    [promptAlert dismissWithClickedButtonIndex:0 animated:NO];
    promptAlert = nil;
}

#pragma mark - 创建底部的scroll
-(void)createScrollV
{
    //滚动视图
    sscroll = [[UIScrollView alloc] initWithFrame:CGRectMake(0, 0,screenW,screenH)];
    //设置contentSize大小
    //初始化界面
    if([_whichKind isEqualToString:@""] || _whichKind == nil)
    {
        sscroll.contentSize = CGSizeMake(screenW, 1600);
    }
    else
    {
        sscroll.contentSize = CGSizeMake(screenW, 2000);
    }
    //设置滚动条的显示
    //水平滚动条
    sscroll.showsHorizontalScrollIndicator = NO;
    //垂直滚动条
    sscroll.showsVerticalScrollIndicator = YES;
    //设置翻页效果
    sscroll.pagingEnabled = NO;
    //设置弹簧效果
    sscroll.bounces = NO;
    [self.view addSubview:sscroll];
}

#pragma mark - 初始化图片显示界面 有图片上报
-(void)createPhotoView
{
    UICollectionViewFlowLayout *flowLayout =[[UICollectionViewFlowLayout alloc] init];
    photosCollectionView  = [[UICollectionView alloc] initWithFrame:CGRectMake(10, vv.frame.size.height + 70, screenW - 20, 160) collectionViewLayout:flowLayout];
    [photosCollectionView registerClass:[UICollectionViewCell class] forCellWithReuseIdentifier:@"photocell"];
    photosCollectionView.backgroundColor = [UIColor whiteColor];
    photosCollectionView.dataSource = self;
    photosCollectionView.delegate = self;
    sscroll.contentSize = CGSizeMake(screenW, vv.frame.size.height + 320);
    [sscroll addSubview:photosCollectionView];
    //NSLog(@"%f", photosCollectionView.frame.origin.y - vv.frame.size.height - vv.frame.origin.y);
}

#pragma mark - 初始化图片显示界面 没有图片上报
-(void)createPhotoView2
{
    UICollectionViewFlowLayout *flowLayout =[[UICollectionViewFlowLayout alloc] init];
    photosCollectionView  = [[UICollectionView alloc] initWithFrame:CGRectMake(10, vv2.frame.size.height + vv2.frame.origin.y + 30, screenW - 20, 160) collectionViewLayout:flowLayout];
    [photosCollectionView registerClass:[UICollectionViewCell class] forCellWithReuseIdentifier:@"photocell"];
    photosCollectionView.backgroundColor = [UIColor whiteColor];
    photosCollectionView.dataSource = self;
    photosCollectionView.delegate = self;
    [sscroll addSubview:photosCollectionView];
    sscroll.contentSize = CGSizeMake(screenW, vv.frame.size.height + vv2.frame.size.height + 380);
    //NSLog(@"%f", photosCollectionView.frame.origin.y - vv2.frame.size.height - vv2.frame.origin.y);
}

#pragma mark - UICollectionView的代理
-(void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath
{
    [self ClickActiondo2:(int)indexPath.row];
}

#pragma mark - 单击图片显示预览
-(void)ClickActiondo2:(int)sender
{
    GBShowPhotoViewController *showPhoto = [[GBShowPhotoViewController alloc] init];
    NSMutableArray *photoArrayCop = [NSMutableArray array];
    
    for(int i = 0; i < photoArray.count; i++)
    {
        UIImage *im = photoArray[i];
        KDLog(@"1  %f", im.size.height);
        
        if (im.size.height > 10000.0 || im.size.width > 10000.0)
        {
            CGSize imgSize = CGSizeMake(im.size.width / 10, im.size.height / 10);
            
            UIGraphicsBeginImageContext(imgSize);
            [photoArray[i] drawInRect:CGRectMake(0, 0, imgSize.width, imgSize.height)];
            UIImage* newImage = UIGraphicsGetImageFromCurrentImageContext();
            UIGraphicsEndImageContext();
            NSData *_data = UIImageJPEGRepresentation(newImage, 1.0f);
            UIImage *im2 = [UIImage imageWithData:_data];
            [photoArrayCop addObject:im2];
        }
        else
        {
            [photoArrayCop addObject:photoArray[i]];
        }
    }
    
    for(int i = 0; i < photoArrayCop.count; i++)
    {
        UIImage *im = photoArrayCop[i];
        KDLog(@"2   %f", im.size.height);
        
        [showPhoto.data addObject:photoArrayCop[i]];
    }
    
    showPhoto.index = sender;
    UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:showPhoto];
    [UIView animateWithDuration:0.5 animations:^{
        [self presentViewController:nav animated:YES completion:nil];
    }];
}

#pragma mark - 定义每个cell的大小
-(CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath
{
    return CGSizeMake(PhotoWidth,PhotoWidth);
}

#pragma mark - 定义每个Section的margin
-(UIEdgeInsets)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout insetForSectionAtIndex:(NSInteger)section
{
    return UIEdgeInsetsMake(10, 10, 10, 10); //分别为上、左、下、右
}

#pragma mark - 定义cell的个数
-(NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section
{
    return _photoArrayUrl.count;
}

#pragma mark - 显示cell
-(UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath
{
    UICollectionViewCell *cell=[collectionView dequeueReusableCellWithReuseIdentifier:@"photocell" forIndexPath:indexPath];
    UIImageView *imageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, PhotoWidth, PhotoWidth)];
    imageView.tag = indexPath.row + 100;
    
    while ([cell.contentView.subviews lastObject] != nil)
    {
        [(UIView*)[cell.contentView.subviews lastObject] removeFromSuperview];
    }
    //NSLog(@"%@",_photoArrayUrl);
    [imageView sd_setImageWithURL:_photoArrayUrl[indexPath.row]];
    UIImage *ima = [UIImage imageWithData:[NSData dataWithContentsOfURL:[NSURL URLWithString:_photoArrayUrl[indexPath.row]]]];
    if(ima != nil)
    {
        [photoArray addObject:ima];
    }
    //imageView.image = [UIImage imageNamed:photoArray[indexPath.row]];
    imageView.contentMode = UIViewContentModeScaleAspectFit;
    [cell.contentView addSubview:imageView];
    return  cell;
}

#pragma mark - 初始化界面 有图片时
-(void)createView1
{
    UILabel *label0 = [[UILabel alloc] initWithFrame:CGRectMake(20 , 5, 70, 30)];
    label0.text = @"上报信息";
    label0.font = [UIFont systemFontOfSize:15];
    label0.textColor = [UIColor blackColor];
    [sscroll addSubview:label0];
    
    vv = [[UIView alloc] initWithFrame:CGRectMake(10, 40, screenW - 20, 1600)];
    vv.backgroundColor = [UIColor whiteColor];
    
    UILabel *label1 = [[UILabel alloc] initWithFrame:CGRectMake(10, 5, 70, 30)];
    label1.text = @"报送标题";
    label1.font = [UIFont systemFontOfSize:15];
    label1.textColor = [UIColor blackColor];
    UILabel *label2 = [[UILabel alloc] initWithFrame:CGRectMake(10, 35, screenW - 40, 30)];
    if([_titleString isEqualToString:@""])
    {
        label2.text = @"无";
    }
    else
    {
        label2.text = _titleString;
    }
    label2.font = [UIFont systemFontOfSize:15];
    label2.backgroundColor = [UIColor whiteColor];
    label2.textColor = [UIColor lightGrayColor];
    [vv addSubview:label2];
    [vv addSubview:label1];
    
    UILabel *labelll24 = [[UILabel alloc] initWithFrame:CGRectMake(10, 67.5, screenW - 40, 1)];
    labelll24.backgroundColor = WQColor(241, 243, 244);
    [vv addSubview:labelll24];
    
    UILabel *label3 = [[UILabel alloc] initWithFrame:CGRectMake(10, 70, 70, 30)];
    label3.text = @"时间";
    label3.font = [UIFont systemFontOfSize:15];
    label3.textColor = [UIColor blackColor];
    UILabel *label4 = [[UILabel alloc] initWithFrame:CGRectMake(10, 105, screenW - 40, 30)];
    if([_timeString isEqualToString:@""])
    {
        label4.text = @"无";
    }
    else
    {
        label4.text = _timeString;
    }
    label4.font = [UIFont systemFontOfSize:15];
    label4.backgroundColor = [UIColor whiteColor];
    label4.textColor = [UIColor lightGrayColor];
    [vv addSubview:label3];
    [vv addSubview:label4];
    
    UILabel *labelll25 = [[UILabel alloc] initWithFrame:CGRectMake(10, 137.5, screenW - 40, 1)];
    labelll25.backgroundColor = WQColor(241, 243, 244);
    [vv addSubview:labelll25];
    
    UILabel *label5 = [[UILabel alloc] initWithFrame:CGRectMake(10, 140, 70, 30)];
    label5.text = @"上报类型";
    label5.font = [UIFont systemFontOfSize:15];
    label5.textColor = [UIColor blackColor];
    UILabel *label6 = [[UILabel alloc] initWithFrame:CGRectMake(10, 175, screenW - 40, 30)];
    if([_reportType isEqualToString:@""])
    {
        label6.text = @"无";
    }
    else
    {
        label6.text = _reportType;
    }
    label6.backgroundColor = [UIColor whiteColor];
    label6.font = [UIFont systemFontOfSize:15];
    label6.textColor = [UIColor lightGrayColor];
    [vv addSubview:label5];
    [vv addSubview:label6];
    
    UILabel *labelll26 = [[UILabel alloc] initWithFrame:CGRectMake(10, 207.5, screenW - 40, 1)];
    labelll26.backgroundColor = WQColor(241, 243, 244);
    [vv addSubview:labelll26];
    
    UILabel *label7 = [[UILabel alloc] initWithFrame:CGRectMake(10, 210, 70, 30)];
    label7.text = @"信息类别";
    label7.font = [UIFont systemFontOfSize:15];
    label7.textColor = [UIColor blackColor];
    UILabel *label8 = [[UILabel alloc] initWithFrame:CGRectMake(10, 245, screenW - 40, 30)];
    if([_infoType isEqualToString:@""])
    {
        label8.text = @"无";
    }
    else
    {
        label8.text = _infoType;
    }
    label8.backgroundColor = [UIColor whiteColor];
    label8.font = [UIFont systemFontOfSize:15];
    label8.textColor = [UIColor lightGrayColor];
    [vv addSubview:label7];
    [vv addSubview:label8];
    
    UILabel *labelll76 = [[UILabel alloc] initWithFrame:CGRectMake(10, 277.5, screenW - 40, 1)];
    labelll76.backgroundColor = WQColor(241, 243, 244);
    [vv addSubview:labelll76];
    
    UILabel *label9 = [[UILabel alloc] initWithFrame:CGRectMake(10, 280, 70, 30)];
    label9.text = @"线索类型";
    label9.font = [UIFont systemFontOfSize:15];
    label9.textColor = [UIColor blackColor];
    UILabel *label10 = [[UILabel alloc] initWithFrame:CGRectMake(10, 315, screenW - 40, 30)];
    if([_kindString isEqualToString:@""])
    {
        label10.text = @"无";
    }
    else
    {
        for(int i = 0; i < kindIdArr.count; i++)
        {
            if([kindIdArr[i] isEqualToString:_kindString])
            {
                label10.text = kindArr[i];
            }
        }
    }
    label10.backgroundColor = [UIColor whiteColor];
    label10.font = [UIFont systemFontOfSize:15];
    label10.textColor = [UIColor lightGrayColor];
    [vv addSubview:label9];
    [vv addSubview:label10];
    
    UILabel *labelll75 = [[UILabel alloc] initWithFrame:CGRectMake(10, 347.5, screenW - 40, 1)];
    labelll75.backgroundColor = WQColor(241, 243, 244);
    [vv addSubview:labelll75];
    
    UILabel *label11 = [[UILabel alloc] initWithFrame:CGRectMake(10, 350, 70, 30)];
    label11.text = @"涉及辖区";
    label11.font = [UIFont systemFontOfSize:15];
    label11.textColor = [UIColor blackColor];
    UILabel *label12 = [[UILabel alloc] initWithFrame:CGRectMake(10, 385, screenW - 40, 30)];
    if([_location isEqualToString:@""])
    {
        label12.text = @"无";
    }
    else
    {
       label12.text = [KDReginDataTool getAreaNameWithID:_location];
    }
    label12.backgroundColor = [UIColor whiteColor];
    label12.font = [UIFont systemFontOfSize:15];
    label12.textColor = [UIColor lightGrayColor];
    [vv addSubview:label11];
    [vv addSubview:label12];
    
    UILabel *labelll74 = [[UILabel alloc] initWithFrame:CGRectMake(10, 417.5, screenW - 40, 1)];
    labelll74.backgroundColor = WQColor(241, 243, 244);
    [vv addSubview:labelll74];
    
    UILabel *label13 = [[UILabel alloc] initWithFrame:CGRectMake(10, 420, 70, 30)];
    label13.text = @"报送内容";
    label13.font = [UIFont systemFontOfSize:15];
    label13.textColor = [UIColor blackColor];
    UILabel *contentLabelzz = [[UILabel alloc] initWithFrame:CGRectMake(11, 455, screenW - 42, 70)];
    if([_taskNei isEqualToString:@""])
    {
        contentLabelzz.text = @"无";
    }
    else
    {
        contentLabelzz.text = _taskNei;
    }
    //label的高度
    float height = [self countTheHeight:_taskNei];
    contentLabelzz.frame = CGRectMake(11, 455, screenW - 42, height);
    UIFont *fnt = [UIFont fontWithName:@"HelveticaNeue" size:15.0f];
    contentLabelzz.font = fnt;
    contentLabelzz.numberOfLines = 0;
    contentLabelzz.lineBreakMode = NSLineBreakByWordWrapping;
    contentLabelzz.textColor = [UIColor lightGrayColor];
    [vv addSubview:label13];
    [vv addSubview:contentLabelzz];
    
    UILabel *labelll73 = [[UILabel alloc] initWithFrame:CGRectMake(10, contentLabelzz.frame.size.height + contentLabelzz.frame.origin.y + 10, screenW - 40, 1)];
    labelll73.backgroundColor = WQColor(241, 243, 244);
    [vv addSubview:labelll73];
    
    UILabel *label14 = [[UILabel alloc] initWithFrame:CGRectMake(10, labelll73.frame.size.height + labelll73.frame.origin.y, 70, 30)];
    label14.text = @"核查人";
    label14.font = [UIFont systemFontOfSize:15];
    label14.textColor = [UIColor blackColor];
    UILabel *label15 = [[UILabel alloc] initWithFrame:CGRectMake(10, label14.frame.size.height + label14.frame.origin.y, screenW - 40, 30)];
    if([_recheckPeople isEqualToString:@""])
    {
        label15.text = @"无";
    }
    else
    {
        label15.text = _recheckPeople;
    }
    label15.backgroundColor = [UIColor whiteColor];
    label15.font = [UIFont systemFontOfSize:15];
    label15.textColor = [UIColor lightGrayColor];
    [vv addSubview:label14];
    [vv addSubview:label15];
    
    UILabel *labelll72 = [[UILabel alloc] initWithFrame:CGRectMake(10, label15.frame.size.height + label15.frame.origin.y + 10, screenW - 40, 1)];
    labelll72.backgroundColor = WQColor(241, 243, 244);
    [vv addSubview:labelll72];
    
    UILabel *label16 = [[UILabel alloc] initWithFrame:CGRectMake(10, labelll72.frame.size.height + labelll72.frame.origin.y, 70, 30)];
    label16.text = @"审核人";
    label16.font = [UIFont systemFontOfSize:15];
    label16.textColor = [UIColor blackColor];
    UILabel *label17 = [[UILabel alloc] initWithFrame:CGRectMake(10, label16.frame.size.height + label16.frame.origin.y, screenW - 40, 30)];
    if([_approvePeople isEqualToString:@""])
    {
        label17.text = @"无";
    }
    else
    {
        label17.text = _approvePeople;
    }
    label17.backgroundColor = [UIColor whiteColor];
    label17.font = [UIFont systemFontOfSize:15];
    label17.textColor = [UIColor lightGrayColor];
    [vv addSubview:label16];
    [vv addSubview:label17];

    UILabel *labelll71 = [[UILabel alloc] initWithFrame:CGRectMake(10, label17.frame.size.height + label17.frame.origin.y + 10, screenW - 40, 1)];
    labelll71.backgroundColor = WQColor(241, 243, 244);
    [vv addSubview:labelll71];
    
    UILabel *label18 = [[UILabel alloc] initWithFrame:CGRectMake(10, labelll71.frame.size.height + labelll71.frame.origin.y, 70, 30)];
    label18.text = @"物理地域";
    label18.font = [UIFont systemFontOfSize:15];
    label18.textColor = [UIColor blackColor];
    UILabel *label19 = [[UILabel alloc] initWithFrame:CGRectMake(10, label18.frame.size.height + label18.frame.origin.y, screenW - 40, 30)];
    if([_geographyRegion isEqualToString:@""])
    {
        label19.text = @"无";
    }
    else
    {
        label19.text = _geographyRegion;
    }
    label19.backgroundColor = [UIColor whiteColor];
    label19.font = [UIFont systemFontOfSize:15];
    label19.textColor = [UIColor lightGrayColor];
    [vv addSubview:label18];
    [vv addSubview:label19];

    UILabel *labelll70 = [[UILabel alloc] initWithFrame:CGRectMake(10, label19.frame.origin.y + label19.frame.size.height + 10, screenW - 40, 1)];
    labelll70.backgroundColor = WQColor(241, 243, 244);
    [vv addSubview:labelll70];
    
    UILabel *label20 = [[UILabel alloc] initWithFrame:CGRectMake(10, labelll70.frame.size.height + labelll70.frame.origin.y, 70, 30)];
    label20.text = @"活动形式";
    label20.font = [UIFont systemFontOfSize:15];
    label20.textColor = [UIColor blackColor];
    UILabel *label21 = [[UILabel alloc] initWithFrame:CGRectMake(10, label20.frame.size.height + label20.frame.origin.y, screenW - 40, 30)];
    if([_activityType isEqualToString:@""])
    {
        label21.text = @"无";
    }
    else
    {
        label21.text = _activityType;
    }
    label21.backgroundColor = [UIColor whiteColor];
    label21.font = [UIFont systemFontOfSize:15];
    label21.textColor = [UIColor lightGrayColor];
    [vv addSubview:label20];
    [vv addSubview:label21];

    UILabel *labelll69 = [[UILabel alloc] initWithFrame:CGRectMake(10, label21.frame.size.height + label21.frame.origin.y + 10, screenW - 40, 1)];
    labelll69.backgroundColor = WQColor(241, 243, 244);
    [vv addSubview:labelll69];
    
    UILabel *label22 = [[UILabel alloc] initWithFrame:CGRectMake(10, labelll69.frame.size.height + labelll69.frame.origin.y, 70, 30)];
    label22.text = @"信息等级";
    label22.font = [UIFont systemFontOfSize:15];
    label22.textColor = [UIColor blackColor];
    UILabel *label23 = [[UILabel alloc] initWithFrame:CGRectMake(10, label22.frame.size.height + label22.frame.origin.y, screenW - 40, 30)];
    if([_infomationLevel isEqualToString:@""])
    {
        label23.text = @"无";
    }
    else
    {
        label23.text = _infomationLevel;
    }
    label23.backgroundColor = [UIColor whiteColor];
    label23.font = [UIFont systemFontOfSize:15];
    label23.textColor = [UIColor lightGrayColor];
    [vv addSubview:label22];
    [vv addSubview:label23];
    
    UILabel *labelll68 = [[UILabel alloc] initWithFrame:CGRectMake(10, label23.frame.size.height + label23.frame.origin.y + 10, screenW - 40, 1)];
    labelll68.backgroundColor = WQColor(241, 243, 244);
    [vv addSubview:labelll68];
    
    UILabel *label24 = [[UILabel alloc] initWithFrame:CGRectMake(10, labelll68.frame.size.height + labelll68.frame.origin.y, 100, 30)];
    label24.text = @"信息归属地";
    label24.font = [UIFont systemFontOfSize:15];
    label24.textColor = [UIColor blackColor];
    UILabel *label25 = [[UILabel alloc] initWithFrame:CGRectMake(10, label24.frame.size.height + label24.frame.origin.y, screenW - 40, 30)];
    if([_infomationRegion isEqualToString:@""])
    {
        label25.text = @"无";
    }
    else
    {
        label25.text = _infomationRegion;
    }
    label25.backgroundColor = [UIColor whiteColor];
    label25.font = [UIFont systemFontOfSize:15];
    label25.textColor = [UIColor lightGrayColor];
    [vv addSubview:label24];
    [vv addSubview:label25];

    UILabel *labelll67 = [[UILabel alloc] initWithFrame:CGRectMake(10, label25.frame.size.height + label25.frame.origin.y + 10, screenW - 40, 1)];
    labelll67.backgroundColor = WQColor(241, 243, 244);
    [vv addSubview:labelll67];
    
    UILabel *label26 = [[UILabel alloc] initWithFrame:CGRectMake(10, labelll67.frame.origin.y + labelll67.frame.size.height, 70, 30)];
    label26.text = @"主关键字";
    label26.font = [UIFont systemFontOfSize:15];
    label26.textColor = [UIColor blackColor];
    UILabel *label27 = [[UILabel alloc] initWithFrame:CGRectMake(10, label26.frame.size.height + label26.frame.origin.y, screenW - 40, 30)];
    if([_mainKeyWord isEqualToString:@""])
    {
        label27.text = @"无";
    }
    else
    {
        label27.text = _mainKeyWord;
    }
    label27.backgroundColor = [UIColor whiteColor];
    label27.font = [UIFont systemFontOfSize:15];
    label27.textColor = [UIColor lightGrayColor];
    [vv addSubview:label26];
    [vv addSubview:label27];

    UILabel *labelll66 = [[UILabel alloc] initWithFrame:CGRectMake(10, label27.frame.size.height + label27.frame.origin.y + 10, screenW - 40, 1)];
    labelll66.backgroundColor = WQColor(241, 243, 244);
    [vv addSubview:labelll66];
    
    UILabel *label28 = [[UILabel alloc] initWithFrame:CGRectMake(10, labelll66.frame.size.height + labelll66.frame.origin.y, 70, 30)];
    label28.text = @"次关键字";
    label28.font = [UIFont systemFontOfSize:15];
    label28.textColor = [UIColor blackColor];
    UILabel *label29 = [[UILabel alloc] initWithFrame:CGRectMake(10, label28.frame.size.height + label28.frame.origin.y, screenW - 40, 30)];
    if([_subKeyWord isEqualToString:@""])
    {
        label29.text = @"无";
    }
    else
    {
        label29.text = _subKeyWord;
    }
    label29.backgroundColor = [UIColor whiteColor];
    label29.font = [UIFont systemFontOfSize:15];
    label29.textColor = [UIColor lightGrayColor];
    [vv addSubview:label28];
    [vv addSubview:label29];
    
    UILabel *labelll65 = [[UILabel alloc] initWithFrame:CGRectMake(10, label29.frame.size.height + label29.frame.origin.y + 10, screenW - 40, 1)];
    labelll65.backgroundColor = WQColor(241, 243, 244);
    [vv addSubview:labelll65];

    UILabel *label30 = [[UILabel alloc] initWithFrame:CGRectMake(10, labelll65.frame.size.height + labelll65.frame.origin.y, 70, 30)];
    label30.text = @"工作要求";
    label30.font = [UIFont systemFontOfSize:15];
    label30.textColor = [UIColor blackColor];
    UILabel *label31 = [[UILabel alloc] initWithFrame:CGRectMake(10, label30.frame.size.height + label30.frame.origin.y, screenW - 40, 30)];
    if([_taskRequired isEqualToString:@""])
    {
        label31.text = @"无";
    }
    else
    {
        label31.text = _taskRequired;
    }
    //label的高度
    float height2 = [self countTheHeight:_taskRequired];
    label31.frame = CGRectMake(11, label30.frame.size.height + label30.frame.origin.y, screenW - 42, height2);
    UIFont *fnt2 = [UIFont fontWithName:@"HelveticaNeue" size:15.0f];
    label31.font = fnt2;
    label31.numberOfLines = 0;
    label31.lineBreakMode = NSLineBreakByWordWrapping;
    label31.textColor = [UIColor lightGrayColor];
    [vv addSubview:label30];
    [vv addSubview:label31];

    UILabel *labelll64 = [[UILabel alloc] initWithFrame:CGRectMake(10, label31.frame.size.height + label31.frame.origin.y + 10, screenW - 40, 1)];
    labelll64.backgroundColor = WQColor(241, 243, 244);
    [vv addSubview:labelll64];

    UILabel *label32 = [[UILabel alloc] initWithFrame:CGRectMake(10,labelll64.frame.origin.y + labelll64.frame.size.height, 70, 30)];
    label32.text = @"其他描述";
    label32.font = [UIFont systemFontOfSize:15];
    label32.textColor = [UIColor blackColor];
    UILabel *describeLabel = [[UILabel alloc] initWithFrame:CGRectMake(10, label32.frame.size.height + label32.frame.origin.y, screenW - 40, 30)];
    if([_taskDescription isEqualToString:@""])
    {
        describeLabel.text = @"无";
    }
    else
    {
        describeLabel.text = _taskDescription;
    }
    //label的高度
    float height3 = [self countTheHeight:_taskDescription];
    describeLabel.frame = CGRectMake(11, label32.frame.size.height + label32.frame.origin.y, screenW - 42, height3);
    UIFont *fnt3 = [UIFont fontWithName:@"HelveticaNeue" size:15.0f];
    describeLabel.font = fnt3;
    describeLabel.numberOfLines = 0;
    describeLabel.lineBreakMode = NSLineBreakByWordWrapping;
    describeLabel.textColor = [UIColor lightGrayColor];
    [vv addSubview:describeLabel];
    [vv addSubview:label32];
    vv.frame = CGRectMake(vv.frame.origin.x, vv.frame.origin.y, vv.frame.size.width, describeLabel.frame.size.height + describeLabel.frame.origin.y + 15);
    sscroll.contentSize = CGSizeMake(screenW, vv.frame.size.height + 50);
    [sscroll addSubview:vv];
    //初始化图片显示界面
    if(_photoArrayUrl.count != 0)
    {
        [self createPhotoView];
    }
}

#pragma mark - 初始化界面 没有图片时
-(void)createView2
{
    //NSLog(@"无图片上报");
    UILabel *label0 = [[UILabel alloc] initWithFrame:CGRectMake(20 , 5, 70, 30)];
    label0.text = @"上报信息";
    label0.font = [UIFont systemFontOfSize:15];
    label0.textColor = [UIColor blackColor];
    [sscroll addSubview:label0];
    
    vv = [[UIView alloc] initWithFrame:CGRectMake(10, 40, screenW - 20, 1125)];
    vv.backgroundColor = [UIColor whiteColor];
    
    UILabel *label1 = [[UILabel alloc] initWithFrame:CGRectMake(10, 5, 70, 30)];
    label1.text = @"报送标题";
    label1.font = [UIFont systemFontOfSize:15];
    label1.textColor = [UIColor blackColor];
    UILabel *label2 = [[UILabel alloc] initWithFrame:CGRectMake(10, 35, screenW - 40, 30)];
    if([_titleString isEqualToString:@""])
    {
        label2.text = @"无";
    }
    else
    {
        label2.text = _titleString;
    }
    label2.font = [UIFont systemFontOfSize:15];
    label2.backgroundColor = [UIColor whiteColor];
    label2.textColor = [UIColor lightGrayColor];
    [vv addSubview:label2];
    [vv addSubview:label1];
    
    UILabel *labelll24 = [[UILabel alloc] initWithFrame:CGRectMake(10, 67.5, screenW - 40, 1)];
    labelll24.backgroundColor = WQColor(241, 243, 244);
    [vv addSubview:labelll24];
    
    UILabel *label3 = [[UILabel alloc] initWithFrame:CGRectMake(10, 70, 70, 30)];
    label3.text = @"时间";
    label3.font = [UIFont systemFontOfSize:15];
    label3.textColor = [UIColor blackColor];
    UILabel *label4 = [[UILabel alloc] initWithFrame:CGRectMake(10, 105, screenW - 40, 30)];
    if([_timeString isEqualToString:@""])
    {
        label4.text = @"无";
    }
    else
    {
        label4.text = _timeString;
    }
    label4.font = [UIFont systemFontOfSize:15];
    label4.backgroundColor = [UIColor whiteColor];
    label4.textColor = [UIColor lightGrayColor];
    [vv addSubview:label3];
    [vv addSubview:label4];
    
    UILabel *labelll25 = [[UILabel alloc] initWithFrame:CGRectMake(10, 137.5, screenW - 40, 1)];
    labelll25.backgroundColor = WQColor(241, 243, 244);
    [vv addSubview:labelll25];
    
    UILabel *label5 = [[UILabel alloc] initWithFrame:CGRectMake(10, 140, 70, 30)];
    label5.text = @"上报类型";
    label5.font = [UIFont systemFontOfSize:15];
    label5.textColor = [UIColor blackColor];
    UILabel *label6 = [[UILabel alloc] initWithFrame:CGRectMake(10, 175, screenW - 40, 30)];
    if([_reportType isEqualToString:@""])
    {
        label6.text = @"无";
    }
    else
    {
        label6.text = _reportType;
    }
    label6.backgroundColor = [UIColor whiteColor];
    label6.font = [UIFont systemFontOfSize:15];
    label6.textColor = [UIColor lightGrayColor];
    [vv addSubview:label5];
    [vv addSubview:label6];
    
    UILabel *labelll26 = [[UILabel alloc] initWithFrame:CGRectMake(10, 207.5, screenW - 40, 1)];
    labelll26.backgroundColor = WQColor(241, 243, 244);
    [vv addSubview:labelll26];
    
    UILabel *label7 = [[UILabel alloc] initWithFrame:CGRectMake(10, 210, 70, 30)];
    label7.text = @"信息类别";
    label7.font = [UIFont systemFontOfSize:15];
    label7.textColor = [UIColor blackColor];
    UILabel *label8 = [[UILabel alloc] initWithFrame:CGRectMake(10, 245, screenW - 40, 30)];
    if([_infoType isEqualToString:@""])
    {
        label8.text = @"无";
    }
    else
    {
        label8.text = _infoType;
    }
    label8.backgroundColor = [UIColor whiteColor];
    label8.font = [UIFont systemFontOfSize:15];
    label8.textColor = [UIColor lightGrayColor];
    [vv addSubview:label7];
    [vv addSubview:label8];
    
    UILabel *labelll74 = [[UILabel alloc] initWithFrame:CGRectMake(10, 277.5, screenW - 40, 1)];
    labelll74.backgroundColor = WQColor(241, 243, 244);
    [vv addSubview:labelll74];
    
    UILabel *label13 = [[UILabel alloc] initWithFrame:CGRectMake(10, 280, 70, 30)];
    label13.text = @"报送内容";
    label13.font = [UIFont systemFontOfSize:15];
    label13.textColor = [UIColor blackColor];
    UILabel *contentLabelzz = [[UILabel alloc] initWithFrame:CGRectMake(5, 315, screenW - 30, 70)];
    if([_taskNei isEqualToString:@""])
    {
        contentLabelzz.text = @"无";
    }
    else
    {
        contentLabelzz.text = _taskNei;
    }
    //label的高度
    float height = [self countTheHeight:_taskNei];
    contentLabelzz.frame = CGRectMake(11, 315, screenW - 42, height);
    UIFont *fnt = [UIFont fontWithName:@"HelveticaNeue" size:15.0f];
    contentLabelzz.font = fnt;
    contentLabelzz.numberOfLines = 0;
    contentLabelzz.lineBreakMode = NSLineBreakByWordWrapping;
    contentLabelzz.textColor = [UIColor lightGrayColor];
    [vv addSubview:label13];
    [vv addSubview:contentLabelzz];
    
    UILabel *labelll73 = [[UILabel alloc] initWithFrame:CGRectMake(10, contentLabelzz.frame.size.height + contentLabelzz.frame.origin.y + 10 , screenW - 40, 1)];
    labelll73.backgroundColor = WQColor(241, 243, 244);
    [vv addSubview:labelll73];
    
    UILabel *label14 = [[UILabel alloc] initWithFrame:CGRectMake(10, labelll73.frame.size.height + labelll73.frame.origin.y, 70, 30)];
    label14.text = @"核查人";
    label14.font = [UIFont systemFontOfSize:15];
    label14.textColor = [UIColor blackColor];
    UILabel *label15 = [[UILabel alloc] initWithFrame:CGRectMake(11, label14.frame.size.height + label14.frame.origin.y, screenW - 42, 30)];
    if([_recheckPeople isEqualToString:@""])
    {
        label15.text = @"无";
    }
    else
    {
        label15.text = _recheckPeople;
    }
    label15.backgroundColor = [UIColor whiteColor];
    label15.font = [UIFont systemFontOfSize:15];
    label15.textColor = [UIColor lightGrayColor];
    [vv addSubview:label14];
    [vv addSubview:label15];

    UILabel *labelll72 = [[UILabel alloc] initWithFrame:CGRectMake(10, label15.frame.size.height + label15.frame.origin.y + 10, screenW - 40, 1)];
    labelll72.backgroundColor = WQColor(241, 243, 244);
    [vv addSubview:labelll72];
    
    UILabel *label16 = [[UILabel alloc] initWithFrame:CGRectMake(10, labelll72.frame.size.height + labelll72.frame.origin.y, 70, 30)];
    label16.text = @"审核人";
    label16.font = [UIFont systemFontOfSize:15];
    label16.textColor = [UIColor blackColor];
    UILabel *label17 = [[UILabel alloc] initWithFrame:CGRectMake(10, label16.frame.size.height + label16.frame.origin.y, screenW - 40, 30)];
    if([_approvePeople isEqualToString:@""])
    {
        label17.text = @"无";
    }
    else
    {
        label17.text = _approvePeople;
    }
    label17.backgroundColor = [UIColor whiteColor];
    label17.font = [UIFont systemFontOfSize:15];
    label17.textColor = [UIColor lightGrayColor];
    [vv addSubview:label16];
    [vv addSubview:label17];

    UILabel *labelll71 = [[UILabel alloc] initWithFrame:CGRectMake(10, label17.frame.size.height + label17.frame.origin.y + 10, screenW - 40, 1)];
    labelll71.backgroundColor = WQColor(241, 243, 244);
    [vv addSubview:labelll71];
    
    UILabel *label18 = [[UILabel alloc] initWithFrame:CGRectMake(10, labelll71.frame.size.height + labelll71.frame.origin.y, 70, 30)];
    label18.text = @"物理地域";
    label18.font = [UIFont systemFontOfSize:15];
    label18.textColor = [UIColor blackColor];
    UILabel *label19 = [[UILabel alloc] initWithFrame:CGRectMake(10, label18.frame.size.height + label18.frame.origin.y, screenW - 40, 30)];
    if([_geographyRegion isEqualToString:@""])
    {
        label19.text = @"无";
    }
    else
    {
        label19.text = _geographyRegion;
    }
    label19.backgroundColor = [UIColor whiteColor];
    label19.font = [UIFont systemFontOfSize:15];
    label19.textColor = [UIColor lightGrayColor];
    [vv addSubview:label18];
    [vv addSubview:label19];

    UILabel *labelll70 = [[UILabel alloc] initWithFrame:CGRectMake(10, label19.frame.size.height + label19.frame.origin.y + 10, screenW - 40, 1)];
    labelll70.backgroundColor = WQColor(241, 243, 244);
    [vv addSubview:labelll70];
    
    UILabel *label20 = [[UILabel alloc] initWithFrame:CGRectMake(10, labelll70.frame.origin.y + labelll70.frame.size.height, 70, 30)];
    label20.text = @"活动形式";
    label20.font = [UIFont systemFontOfSize:15];
    label20.textColor = [UIColor blackColor];
    UILabel *label21 = [[UILabel alloc] initWithFrame:CGRectMake(10, label20.frame.size.height + label20.frame.origin.y, screenW - 40, 30)];
    if([_activityType isEqualToString:@""])
    {
        label21.text = @"无";
    }
    else
    {
        label21.text = _activityType;
    }
    label21.backgroundColor = [UIColor whiteColor];
    label21.font = [UIFont systemFontOfSize:15];
    label21.textColor = [UIColor lightGrayColor];
    [vv addSubview:label20];
    [vv addSubview:label21];

    UILabel *labelll69 = [[UILabel alloc] initWithFrame:CGRectMake(10, label21.frame.size.height + label21.frame.origin.y + 10, screenW - 40, 1)];
    labelll69.backgroundColor = WQColor(241, 243, 244);
    [vv addSubview:labelll69];
    
    UILabel *label22 = [[UILabel alloc] initWithFrame:CGRectMake(10, labelll69.frame.size.height + labelll69.frame.origin.y, 70, 30)];
    label22.text = @"信息等级";
    label22.font = [UIFont systemFontOfSize:15];
    label22.textColor = [UIColor blackColor];
    UILabel *label23 = [[UILabel alloc] initWithFrame:CGRectMake(10, label22.frame.size.height + label22.frame.origin.y, screenW - 40, 30)];
    if([_infomationLevel isEqualToString:@""])
    {
        label23.text = @"无";
    }
    else
    {
        label23.text = _infomationLevel;
    }
    label23.backgroundColor = [UIColor whiteColor];
    label23.font = [UIFont systemFontOfSize:15];
    label23.textColor = [UIColor lightGrayColor];
    [vv addSubview:label22];
    [vv addSubview:label23];

    UILabel *labelll68 = [[UILabel alloc] initWithFrame:CGRectMake(10, label23.frame.size.height + label23.frame.origin.y + 10, screenW - 40, 1)];
    labelll68.backgroundColor = WQColor(241, 243, 244);
    [vv addSubview:labelll68];
    
    UILabel *label24 = [[UILabel alloc] initWithFrame:CGRectMake(10, labelll68.frame.size.height + labelll68.frame.origin.y, 100, 30)];
    label24.text = @"信息归属地";
    label24.font = [UIFont systemFontOfSize:15];
    label24.textColor = [UIColor blackColor];
    UILabel *label25 = [[UILabel alloc] initWithFrame:CGRectMake(10, label24.frame.size.height + label24.frame.origin.y, screenW - 40, 30)];
    if([_infomationRegion isEqualToString:@""])
    {
        label25.text = @"无";
    }
    else
    {
        label25.text = _infomationRegion;
    }
    label25.backgroundColor = [UIColor whiteColor];
    label25.font = [UIFont systemFontOfSize:15];
    label25.textColor = [UIColor lightGrayColor];
    [vv addSubview:label24];
    [vv addSubview:label25];

    UILabel *labelll67 = [[UILabel alloc] initWithFrame:CGRectMake(10, label25.frame.size.height + label25.frame.origin.y + 10, screenW - 40, 1)];
    labelll67.backgroundColor = WQColor(241, 243, 244);
    [vv addSubview:labelll67];
    
    UILabel *label26 = [[UILabel alloc] initWithFrame:CGRectMake(10, labelll67.frame.size.height + labelll67.frame.origin.y, 70, 30)];
    label26.text = @"主关键字";
    label26.font = [UIFont systemFontOfSize:15];
    label26.textColor = [UIColor blackColor];
    UILabel *label27 = [[UILabel alloc] initWithFrame:CGRectMake(10, label26.frame.size.height + label26.frame.origin.y, screenW - 40, 30)];
    if([_mainKeyWord isEqualToString:@""])
    {
        label27.text = @"无";
    }
    else
    {
        label27.text = _mainKeyWord;
    }
    label27.backgroundColor = [UIColor whiteColor];
    label27.font = [UIFont systemFontOfSize:15];
    label27.textColor = [UIColor lightGrayColor];
    [vv addSubview:label26];
    [vv addSubview:label27];

    UILabel *labelll66 = [[UILabel alloc] initWithFrame:CGRectMake(10, label27.frame.size.height + label27.frame.origin.y + 10, screenW - 40, 1)];
    labelll66.backgroundColor = WQColor(241, 243, 244);
    [vv addSubview:labelll66];
    
    UILabel *label28 = [[UILabel alloc] initWithFrame:CGRectMake(10, labelll66.frame.size.height + labelll66.frame.origin.y, 70, 30)];
    label28.text = @"次关键字";
    label28.font = [UIFont systemFontOfSize:15];
    label28.textColor = [UIColor blackColor];
    UILabel *label29 = [[UILabel alloc] initWithFrame:CGRectMake(10, label28.frame.size.height + label28.frame.origin.y, screenW - 40, 30)];
    if([_subKeyWord isEqualToString:@""])
    {
        label29.text = @"无";
    }
    else
    {
        label29.text = _subKeyWord;
    }
    label29.backgroundColor = [UIColor whiteColor];
    label29.font = [UIFont systemFontOfSize:15];
    label29.textColor = [UIColor lightGrayColor];
    [vv addSubview:label28];
    [vv addSubview:label29];

    UILabel *labelll65 = [[UILabel alloc] initWithFrame:CGRectMake(10, label29.frame.size.height + label29.frame.origin.y + 10, screenW - 40, 1)];
    labelll65.backgroundColor = WQColor(241, 243, 244);
    [vv addSubview:labelll65];
    
    UILabel *label30 = [[UILabel alloc] initWithFrame:CGRectMake(10, labelll65.frame.size.height + labelll65.frame.origin.y, 70, 30)];
    label30.text = @"工作要求";
    label30.font = [UIFont systemFontOfSize:15];
    label30.textColor = [UIColor blackColor];
    UILabel *label31 = [[UILabel alloc] initWithFrame:CGRectMake(10, label30.frame.size.height + label30.frame.origin.y, screenW - 40, 30)];
    if([_taskRequired isEqualToString:@""])
    {
        label31.text = @"无";
    }
    else
    {
        label31.text = _taskRequired;
    }
    //label的高度
    float height2 = [self countTheHeight:_taskRequired];
    label31.frame = CGRectMake(11, label30.frame.size.height + label30.frame.origin.y + 10, screenW - 42, height2);
    UIFont *fnt2 = [UIFont fontWithName:@"HelveticaNeue" size:15.0f];
    label31.font = fnt2;
    label31.numberOfLines = 0;
    label31.lineBreakMode = NSLineBreakByWordWrapping;
    label31.textColor = [UIColor lightGrayColor];
    [vv addSubview:label30];
    [vv addSubview:label31];

    UILabel *labelll64 = [[UILabel alloc] initWithFrame:CGRectMake(10, label31.frame.size.height + label31.frame.origin.y + 15, screenW - 40, 1)];
    labelll64.backgroundColor = WQColor(241, 243, 244);
    [vv addSubview:labelll64];

    UILabel *label32 = [[UILabel alloc] initWithFrame:CGRectMake(10, labelll64.frame.size.height + labelll64.frame.origin.y, 70, 30)];
    label32.text = @"其他描述";
    label32.font = [UIFont systemFontOfSize:15];
    label32.textColor = [UIColor blackColor];
    UILabel *describeLabelzz = [[UILabel alloc] initWithFrame:CGRectMake(10, label32.frame.size.height + label32.frame.origin.y, screenW - 40, 30)];
    if([_taskDescription isEqualToString:@""])
    {
        describeLabelzz.text = @"无";
    }
    else
    {
        describeLabelzz.text = _taskDescription;
    }
    //label的高度
    float height3 = [self countTheHeight:_taskDescription];
    describeLabelzz.frame = CGRectMake(11, label32.frame.size.height + label32.frame.origin.y + 10, screenW - 42, height3);
    UIFont *fnt3 = [UIFont fontWithName:@"HelveticaNeue" size:15.0f];
    describeLabelzz.font = fnt3;
    describeLabelzz.numberOfLines = 0;
    describeLabelzz.lineBreakMode = NSLineBreakByWordWrapping;
    describeLabelzz.textColor = [UIColor lightGrayColor];
    [vv addSubview:describeLabelzz];
    [vv addSubview:label32];
    vv.frame = CGRectMake(10, 40, screenW - 20, describeLabelzz.frame.size.height + describeLabelzz.frame.origin.y + 15);
    [sscroll addSubview:vv];
    
    //原始信息
    vv2 = [[UIView alloc] initWithFrame:CGRectMake(10, vv.frame.origin.y + vv.frame.size.height + 40, screenW - 20, screenH + 150)];
    vv2.backgroundColor = [UIColor whiteColor];
    [sscroll addSubview:vv2];
    
    UILabel *label121 = [[UILabel alloc] initWithFrame:CGRectMake(20, vv.frame.origin.y + vv.frame.size.height + 5, 70, 30)];
    label121.text = @"原始信息";
    label121.font = [UIFont systemFontOfSize:15];
    label121.textColor = [UIColor blackColor];
    [sscroll addSubview:label121];

    UILabel *label91 = [[UILabel alloc] initWithFrame:CGRectMake(10, 5, 70, 30)];
    label91.text = @"线索类型";
    label91.font = [UIFont systemFontOfSize:15];
    label91.textColor = [UIColor blackColor];
    UILabel *label101 = [[UILabel alloc] initWithFrame:CGRectMake(10, 40, screenW - 40, 30)];
    if([_kindString isEqualToString:@""])
    {
        label101.text = @"无";
    }
    else
    {
        for(int i = 0; i < kindIdArr.count; i++)
        {
            if([kindIdArr[i] isEqualToString:_kindString])
            {
                label101.text = kindArr[i];
            }
        }
        //NSLog(@"%d",clueId);
    }
    label101.backgroundColor = [UIColor whiteColor];
    label101.font = [UIFont systemFontOfSize:15];
    label101.textColor = [UIColor lightGrayColor];
    [vv2 addSubview:label91];
    [vv2 addSubview:label101];
    
    UILabel *labelll75 = [[UILabel alloc] initWithFrame:CGRectMake(10, 72.5, screenW - 40, 1)];
    labelll75.backgroundColor = WQColor(241, 243, 244);
    [vv2 addSubview:labelll75];
    
    UILabel *label11 = [[UILabel alloc] initWithFrame:CGRectMake(10, 75, 70, 30)];
    label11.text = @"涉及辖区";
    label11.font = [UIFont systemFontOfSize:15];
    label11.textColor = [UIColor blackColor];
    UILabel *label12 = [[UILabel alloc] initWithFrame:CGRectMake(10, 110, screenW - 40, 30)];
    if([_location isEqualToString:@""])
    {
        label12.text = @"无";
    }
    else
    {
        label12.text = [KDReginDataTool getAreaNameWithID:_location];
    }
    label12.backgroundColor = [UIColor whiteColor];
    label12.font = [UIFont systemFontOfSize:15];
    label12.textColor = [UIColor lightGrayColor];
    [vv2 addSubview:label11];
    [vv2 addSubview:label12];

    UILabel *labelll55 = [[UILabel alloc] initWithFrame:CGRectMake(10, 142.5, screenW - 40, 1)];
    labelll55.backgroundColor = WQColor(241, 243, 244);
    [vv2 addSubview:labelll55];
    
    UILabel *label131 = [[UILabel alloc] initWithFrame:CGRectMake(10, 145, 70, 30)];
    label131.text = @"信息标题";
    label131.font = [UIFont systemFontOfSize:15];
    label131.textColor = [UIColor blackColor];
    UILabel *label141 = [[UILabel alloc] initWithFrame:CGRectMake(10, 180, screenW - 40, 30)];
    if([_messageTitle isEqualToString:@""])
    {
        label141.text = @"无";
    }
    else
    {
        label141.text = _messageTitle;
    }
    label141.font = [UIFont systemFontOfSize:15];
    label141.backgroundColor = [UIColor whiteColor];
    label141.textColor = [UIColor lightGrayColor];
    [vv2 addSubview:label131];
    [vv2 addSubview:label141];
    
    UILabel *labelll31 = [[UILabel alloc] initWithFrame:CGRectMake(10, 212.5, screenW - 40, 1)];
    labelll31.backgroundColor = WQColor(241, 243, 244);
    [vv2 addSubview:labelll31];
    
    UILabel *label211 = [[UILabel alloc] initWithFrame:CGRectMake(10, 215, 70, 30)];
    label211.text = @"信息时间";
    label211.font = [UIFont systemFontOfSize:15];
    label211.textColor = [UIColor blackColor];
    UILabel *label221 = [[UILabel alloc] initWithFrame:CGRectMake(10, 250, screenW - 40, 30)];
    if([_messageTime isEqualToString:@""])
    {
        label221.text = @"无";
    }
    else
    {
        label221.text = _messageTime;
    }
    label221.font = [UIFont systemFontOfSize:15];
    label221.backgroundColor = [UIColor whiteColor];
    label221.textColor = [UIColor lightGrayColor];
    [vv2 addSubview:label211];
    [vv2 addSubview:label221];
    
    UILabel *labelll32 = [[UILabel alloc] initWithFrame:CGRectMake(10, 282.5, screenW - 40, 1)];
    labelll32.backgroundColor = WQColor(241, 243, 244);
    [vv2 addSubview:labelll32];
    
    UILabel *label171 = [[UILabel alloc] initWithFrame:CGRectMake(10, 285, 70, 30)];
    label171.text = @"发帖网名";
    label171.font = [UIFont systemFontOfSize:15];
    label171.textColor = [UIColor blackColor];
    UILabel *label181 = [[UILabel alloc] initWithFrame:CGRectMake(10, 320, screenW - 40, 30)];
    if([_author isEqualToString:@""])
    {
        label181.text = @"无";
    }
    else
    {
        label181.text = _author;
    }
    label181.font = [UIFont systemFontOfSize:15];
    label181.backgroundColor = [UIColor whiteColor];
    label181.textColor = [UIColor lightGrayColor];
    [vv2 addSubview:label171];
    [vv2 addSubview:label181];
    
    UILabel *labelll323 = [[UILabel alloc] initWithFrame:CGRectMake(10, 352.5, screenW - 40, 1)];
    labelll323.backgroundColor = WQColor(241, 243, 244);
    [vv2 addSubview:labelll323];
    
    UILabel *label1714 = [[UILabel alloc] initWithFrame:CGRectMake(10, 355, 70, 30)];
    label1714.text = @"网站名称";
    label1714.font = [UIFont systemFontOfSize:15];
    label1714.textColor = [UIColor blackColor];
    UILabel *label1812 = [[UILabel alloc] initWithFrame:CGRectMake(10, 390, screenW - 40, 30)];
    if([_webName isEqualToString:@""])
    {
        label1812.text = @"无";
    }
    else
    {
        label1812.text = _webName;
    }
    label1812.font = [UIFont systemFontOfSize:15];
    label1812.backgroundColor = [UIColor whiteColor];
    label1812.textColor = [UIColor lightGrayColor];
    [vv2 addSubview:label1812];
    [vv2 addSubview:label1714];
    
    UILabel *labelll3231 = [[UILabel alloc] initWithFrame:CGRectMake(10, 422.5, screenW - 40, 1)];
    labelll3231.backgroundColor = WQColor(241, 243, 244);
    [vv2 addSubview:labelll3231];
    
    UILabel *label17141 = [[UILabel alloc] initWithFrame:CGRectMake(10, 425, 70, 30)];
    label17141.text = @"网站类型";
    label17141.font = [UIFont systemFontOfSize:15];
    label17141.textColor = [UIColor blackColor];
    UILabel *label18121 = [[UILabel alloc] initWithFrame:CGRectMake(10, 460, screenW - 40, 30)];
    if([_websiteType isEqualToString:@""])
    {
        label18121.text = @"无";
    }
    else
    {
        label18121.text = [websiteTypeArray objectAtIndex:[_websiteType intValue]];
    }
    label18121.font = [UIFont systemFontOfSize:15];
    label18121.backgroundColor = [UIColor whiteColor];
    label18121.textColor = [UIColor lightGrayColor];
    [vv2 addSubview:label18121];
    [vv2 addSubview:label17141];
    
    UILabel *labelll3234 = [[UILabel alloc] initWithFrame:CGRectMake(10, 492.5, screenW - 40, 1)];
    labelll3234.backgroundColor = WQColor(241, 243, 244);
    [vv2 addSubview:labelll3234];
    
    UILabel *label151 = [[UILabel alloc] initWithFrame:CGRectMake(10, 495, 70, 30)];
    label151.text = @"URL地址";
    label151.font = [UIFont systemFontOfSize:15];
    label151.textColor = [UIColor blackColor];
    UIButton *webUrlBtn = [UIButton buttonWithType:0];
    webUrlBtn.titleLabel.textAlignment = NSTextAlignmentLeft;
    webUrlBtn.titleEdgeInsets = UIEdgeInsetsMake(0, 0, 0, 0);
    webUrlBtn.frame = CGRectMake(10,530, screenW - 40, 30);
    [webUrlBtn setTitleColor:[UIColor blueColor] forState:UIControlStateNormal];
    [webUrlBtn addTarget:self action:@selector(goToTheWebview) forControlEvents:UIControlEventTouchUpInside];
    webUrlBtn.titleLabel.font = [UIFont systemFontOfSize:15];
    if([_whichKind isEqualToString:@""])
    {
        [webUrlBtn setTitle:@"无" forState:UIControlStateNormal];
    }
    else
    {
        [webUrlBtn setTitle:_whichKind forState:UIControlStateNormal];
    }
    webUrlBtn.contentHorizontalAlignment = UIControlContentHorizontalAlignmentLeft;
    //NSLog(@"%@",_whichKind);
    [vv2 addSubview:label151];
    [vv2 addSubview:webUrlBtn];
    
    UILabel *labelll35 = [[UILabel alloc] initWithFrame:CGRectMake(10, 562.5, screenW - 40, 1)];
    labelll35.backgroundColor = WQColor(241, 243, 244);
    [vv2 addSubview:labelll35];
    
    UILabel *label231 = [[UILabel alloc] initWithFrame:CGRectMake(10, 565, 70, 30)];
    label231.text = @"信息内容";
    label231.font = [UIFont systemFontOfSize:15];
    label231.textColor = [UIColor blackColor];
    UILabel *messageContentLabel = [[UILabel alloc] initWithFrame:CGRectMake(10, 600, screenW - 40, 0)];
    if([_messageContent isEqualToString:@""])
    {
        messageContentLabel.text = @"无";
    }
    else
    {
        messageContentLabel.text = _messageContent;
    }
    //label的高度
    float height4 = [self countTheHeight:_messageContent];
    //NSLog(@"%@", _messageContent);
    
    messageContentLabel.frame = CGRectMake(11, 600, screenW - 42, height4);
    UIFont *fnt4 = [UIFont fontWithName:@"HelveticaNeue" size:15.0f];
    messageContentLabel.font = fnt4;
    messageContentLabel.numberOfLines = 0;
    messageContentLabel.textAlignment = NSTextAlignmentLeft;  //文本对齐方式
    messageContentLabel.lineBreakMode = NSLineBreakByWordWrapping;
    messageContentLabel.textColor = [UIColor lightGrayColor];
    vv2.frame = CGRectMake(10, vv2.frame.origin.y, screenW - 20, messageContentLabel.frame.size.height + messageContentLabel.frame.origin.y + 15);
    [vv2 addSubview:label231];
    [vv2 addSubview:messageContentLabel];
    sscroll.contentSize = CGSizeMake(screenW, vv.frame.size.height + vv2.frame.size.height + 180);
    //初始化图片显示界面
    if(_photoArrayUrl.count != 0)
    {
        [self createPhotoView2];
    }
}

#pragma mark - 计算label的高度
-(CGFloat)countTheHeight:(NSString *)labelText
{
    CGFloat contentW = screenW - 42.0f;
    // label的字体 HelveticaNeue  Courier
    UIFont *fnt = [UIFont fontWithName:@"HelveticaNeue" size:15.2f];
    // iOS7中用以下方法替代过时的iOS6中的sizeWithFont:constrainedToSize:lineBreakMode:方法
    CGRect tmpRect = [labelText boundingRectWithSize:CGSizeMake(contentW, 1000000000) options:NSStringDrawingUsesLineFragmentOrigin attributes:[NSDictionary dictionaryWithObjectsAndKeys:fnt,NSFontAttributeName, nil] context:nil];
    // 高度H
    CGFloat contentH = tmpRect.size.height;
    return contentH;
}

#pragma mark - 点击url跳转界面
-(void)goToTheWebview
{
    GBUrlWebViewController *noticeSetup = [[GBUrlWebViewController alloc] init];
    noticeSetup.urlStr = [NSString stringWithFormat:@"%@",_whichKind];
    UIBarButtonItem *backItem = [[UIBarButtonItem alloc] initWithTitle:@"" style:UIBarButtonItemStylePlain target:nil action:nil];
    [self.navigationItem setBackBarButtonItem:backItem];
    [self.navigationController pushViewController:noticeSetup animated:YES];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
